import Vue from 'vue'
import { USER_INFO, ENHANCE_PRE } from "@/store/mutation-types"
const getters = {
  device: state => state.app.device,
  theme: state => state.app.theme,
  color: state => state.app.color,
  token: state => state.user.token,
  avatar: state => {state.user.avatar = Vue.ls.get(USER_INFO).avatar; return state.user.avatar},
  username: state => state.user.username,
  nickname: state => {state.user.realname = Vue.ls.get(USER_INFO).realname; return state.user.realname},
  welcome: state => state.user.welcome,
  permissionList: state => state.user.permissionList,
  userInfo: state => {state.user.info = Vue.ls.get(USER_INFO); return state.user.info},
  addRouters: state => state.permission.addRouters,
  enhanceJs:(state) => (code) => {
    state.enhance.enhanceJs[code] = Vue.ls.get(ENHANCE_PRE+code);
    return state.enhance.enhanceJs[code]
  },
  chufangType: state => state.app.chufangType,
  worklingObj: state => state.app.worklingObj,
  huanzheToken: state => state.app.huanzheToken,
  readCardStatus: state => state.app.readCardStatus,
  weicaiSelected: state => state.app.weicaiSelected,
  modalHaoCaiShow: state => state.app.modalHaoCaiShow,
  wsflag: state => state.app.wsflag,
  wsdzflag: state => state.app.wsdzflag,
  loadingflag: state => state.app.loadingflag,
  readDzObj: state => state.user.readDzObj,
  readInfoObj: state => state.app.readInfoObj,
  historyflag: state => state.app.historyflag,
  historyObj: state => state.app.historyObj,
  onlycardObj: state => state.app.onlycardObj,
  onlycardflag: state => state.app.onlycardflag,
  wsTypeCode: state => state.app.wsTypeCode,
  guoqiAction: state => state.app.guoqiAction,
  isOnlyService: state => state.app.isOnlyService,
  printNewArr: state => state.app.printNewArr,
  nocardFlag: state => state.app.nocardFlag,
  shownoCard: state => state.app.shownoCard,
  globalVUEXInd: state => state.app.globalVUEXInd,
  rlwxtype: state => state.app.rlwxtype,
  userData:state =>state.user.userData,
  shenheClose:state => state.app.shenheClose
}

export default getters